﻿using Microsoft.Practices.ServiceLocation;
using Services.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Books.ViewModel.Paging
{
    public class DataBooksRequest : IPagedSource<BookList>
    {
        private int totalRecord = 0;
        public DataBooksRequest()
        {
        }
       
        public IMainViewModel CallData
        {
            get { return ServiceLocator.Current.GetInstance<IMainViewModel>(); }
        }

        public async Task<IPagedResponse<BookList>> GetPage(PageType refesh, int pageIndex, int pageSize)
        {
            //var getData = await CallData.GetTaskDataMovies(dataRequest);
            //totalRecord = MoviesData.TotalResultItems;
            //return new DataBooksResponse(getData, totalRecord);
            return null;
        }

        public Task<IPagedResponse<BookList>> GetPageDataSearch(PageType refesh, int startIndex, int pageCount)
        {
            throw new NotImplementedException();
        }
    }

    /// <summary>
    ///     Class DataMoviesResponse inherit from IPagedSource<GuideData>
    /// </summary>
    public class DataBooksResponse : IPagedResponse<BookList>
    {

        public DataBooksResponse(ObservableCollection<BookList> items, int virtualCount)
        {
            this.Items = items;
            this.VirtualCount = virtualCount;
        }
  
        /// <summary>
        /// Get, set VirtualCount Properties
        /// </summary>
        public int VirtualCount { get; private set; }

        /// <summary>
        /// Get, set Items Properties
        /// </summary>
        public ObservableCollection<BookList> Items { get; private set; }
       

    }
}
